public class Tank {
    public int getLife() {
        return life;
    }

    public void setLife(int life){
        this.life=life;
    }

    private int life;

    Tank(int x, int y){
        this.x=x;
        this.y=y;
    }
    public void up(){
        if(getY()>0 && getY()-getSpeed()>=0)setY(getY()-getSpeed());
    }

    public void down(){
        if(getY()+42<850 && getY()+getSpeed()+42<=850)setY(getY()+getSpeed());
    }

    public void left(){
        if(getX()-2>0 && getX()-getSpeed()-2>=0)setX(getX()-getSpeed());
    }

    public void right(){
        if(getX()+42<=990 && getX()+getSpeed()+42<=990)setX(getX()+getSpeed());
    }

    private int x,y;

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }
    public int getKind() {
        return kind;
    }

    public void setKind(int kind) {
        this.kind = kind;
    }

    private int speed;

    public int getDir() {
        return dir;
    }

    public void setDir(int dir) {
        this.dir = dir;
    }

    private int dir;
    private int kind;

    public int getAttack() {
        return attack;
    }

    public void setAttack(int attack) {
        this.attack = attack;
    }

    private int attack;
}
